﻿<!--PC INpact App for Chrome™

	PC INpact App for Chrome™ est une application destinée au Chrome Web Store permettant d'acchéder à PC INpact.
	Elle dispose de fonctionnalités spécifiques, telles que la notification de nouvelles actualités, dossiers...

	Main author : LEGRAND David
	Mail : david@pcinpact.com
	
	Google Code Project : http://pci.im/code-pci-chrome 
	Forum : http://pci.im/forum-pci-chrome
	
    This file is part of PC INpact App for Chrome™.

    PC INpact App for Chrome™ is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    PC INpact App for Chrome™ is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with PC INpact App for Chrome™.  If not, see <http://www.gnu.org/licenses/>. 
 
    You're not allowed to use PC INpact App for Chrome™ name or logo without permission -->
	
<html>
<head>
	<script type="text/javascript" src="/js/main.js"></script>
	<script type="text/javascript" src="/js/forum.js"></script>
	<script type="text/javascript" src="/js/notify.js"></script>
	<script type="text/javascript" src="/js/rss.js"></script>
	<script type="text/javascript" src="/js/breves.js"></script>
	<script>
		function init() {
				// On gère le cas du changement de valeur pour notif_check
				if (localStorage["notif_ckeck"] != 0 && localStorage["notif_ckeck"] != 1) localStorage["notif_ckeck"] = 1;
				
				// On gère les valeurs par défaut des options
				if (!localStorage["notif_delay"]) localStorage["notif_delay"] = 15;
				
				if (!localStorage["notif_ckeck"]) localStorage["notif_ckeck"] = 1;
				if (!localStorage["popup_check"]) localStorage["popup_check"] = 0;
				if (!localStorage["actus_redir_check"]) localStorage["actus_redir_check"] = 1;
				
				if (!localStorage["news_delay"]) localStorage["news_delay"] = 1;
				if (!localStorage["breves_delay"]) localStorage["breves_delay"] = 15;				
				if (!localStorage["articles_delay"]) localStorage["articles_delay"] = 15;
				if (!localStorage["forum_delay"]) localStorage["forum_delay"] = 5;
				
				// On check une première fois les flux RSS
				check_rss('news.xml', 'news', 34);
				check_rss('articles.xml', 'articles', 24);
				
				// On check une première fois les brèves 
				check_breves();
				
				// On check une première fois les infos du forum
				get_forum_infos();
				
				// Puis on recommence toutes les X minutes
				var interval_news = localStorage["news_delay"] * 60 * 1000;
				var timer_news = setInterval("check_rss('news.xml', 'news', 34)", interval_news);

				var interval_breves = localStorage["breves_delay"] * 60 * 1000;
				var timer_breves = setInterval("check_breves()", interval_breves);
				
				var interval_articles = localStorage["articles_delay"] * 60 * 1000;
				var timer_articles = setInterval("check_rss('articles.xml', 'articles', 24)", interval_articles);
				
				var interval_forum = localStorage["forum_delay"] * 60 * 1000;
				var timer_forum = setInterval("get_forum_infos()", interval_forum);
		}
	</script>
</head>

<body onload="init()">
</body>

</html>